import 'package:json_annotation/json_annotation.dart';

part 'result_response.g.dart';

@JsonSerializable(genericArgumentFactories: true)
class ResultResponse<T> {
  int code;
  String message;
  T? data;
  ResultResponse(this.code, this.message, this.data);
  factory ResultResponse.fromJson(
          Map<String, dynamic> json, T Function(dynamic json) fromJsonT) =>
      _$ResultResponseFromJson(json, fromJsonT);
  Map<String, dynamic> toJson(Object? Function(T value) toJsonT) =>
      _$ResultResponseToJson(this, toJsonT);
}
